<?php echo $html->link(__('New Field Group', true), am(array('action'=>'add')),array('class'=>'add_button')); ?>
<div class="eavFields index">
<?php
echo "<div class='switcher'>";
echo __("Switch to ").$html->link("Listings Types",array("plugin"=>null,"controller"=>"listing_types","action"=>"index"));
echo "</div><br />";

	$paginator->options(array('url'=>$this->getPagingUrl()));
	
	$showFields = ClassRegistry::getObject($fieldsetModelAlias)->getFields('group',"grid");
	$showLabelIndex = array_search('show_label',$showFields);
	$showFields[$showLabelIndex] = array('show_label'=>'Display Label');
	
	$index->setData($fieldsets, $fieldsetModelAlias);
	
	$index->showFields($showFields);
	$index->sortableFields($showFields );
	
	$index->setAction(null,null,$this->helpers,false,true,'addField');
	$index->setAction('Edit', array('action'=>"edit",":$fieldsetModelAlias.id"));
	$index->setAction('Delete', array('action'=>"delete",":$fieldsetModelAlias.id"),$this->helpers,__('Are you sure you want to delete this fieldset ?'));
	
	$index->setPaginateSeparator(' ');
	echo $index->display();
	
	function addField($model,$result)
	{
		$link['title'] = __('Specify fields');
		$link['url'] = array('controller'=>'custom_fields','action'=>"index",'fieldset'=>$result[$model]['id'],'plugin'=>null);
		return $link;
		 
	}
	
?>
</div>
